package com.cloud.screen.api.controller;

import com.cloud.screen.api.service.HumanInfoService;
import com.cloud.screen.common.result.Quokka;
import com.cloud.screen.interfaces.FeignClientSystem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("screen/api/unitStat")
public class UnitStatController {

    @Autowired
    private FeignClientSystem feignClientSystem;

    @Autowired
    private HumanInfoService humanInfoService;

    /**
     * 部门级别统计(执法机关层级分布)
     *
     * @return
     */
    @RequestMapping("getUnitLevelStat")
    public Quokka getUnitLevelStat(Integer isSupervise,Long regionid) {
        Map<String, Object>  unitLevelStat = humanInfoService.getUnitLevelStat(isSupervise,regionid);
        return new Quokka(true, unitLevelStat);
    }

    /**
     * 监督部门级别统计(监督机构层级分布)
     *
     * @return
     */
    @RequestMapping("getSupUnitLevelStat")
    public Quokka getSupUnitLevelStat(Long regionid) {
        return new Quokka(true, feignClientSystem.getSupUnitLevelStat(regionid));
    }

    /**
     * 内设监督机构级别统计
     *
     * @return
     */
    @RequestMapping("getInnerSupUnitLevelStat")
    public Quokka getInnerSupUnitLevelStat(Long regionid) {
        return new Quokka(true, feignClientSystem.getInnerSupUnitLevelStat(regionid));
    }

    /**
     * 部门性质统计(执法机关性质分布)
     *
     * @return
     */
    @RequestMapping("getUnitNatureStat")
    public Quokka getUnitNatureStat(Integer isSupervise,Long regionid) {
        return new Quokka(true, feignClientSystem.getUnitNatureStat(isSupervise,regionid));
    }

    /**
     * 部门区域统计
     *
     * @return
     */
    @RequestMapping("getUnitAreaStat")
    public Quokka getUnitAreaStat(Integer isSupervise) {
        return new Quokka(true, feignClientSystem.getUnitAreaStat(isSupervise));
    }

    /**
     * 部门区域统计-大屏
     *
     * @return
     */
    @RequestMapping("getUnitAreaStatForScreen")
    public Quokka getUnitAreaStatForScreen(Integer isSupervise,Long regionid) {
        return new Quokka(true, feignClientSystem.getUnitAreaStatForScreen(isSupervise,regionid));
    }

    /**
     * 主体类别统计
     *
     * @return
     */
    @RequestMapping("getLawSubjectStat")
    public Quokka getLawSubjectStat(Long regionid) {
        return new Quokka(true, feignClientSystem.getLawSubjectStat(regionid));
    }

    /**
     * 委托机构方式统计
     *
     * @return
     */
    @RequestMapping("getEntrustUnitStat")
    public Quokka getEntrustUnitStat() {
        return new Quokka(true, feignClientSystem.getEntrustUnitStat());
    }

    /**
     * 委托机构性质统计
     *
     * @return
     */
    @RequestMapping("getEntrustNatureStat")
    public Quokka getEntrustNatureStat() {
        return new Quokka(true, feignClientSystem.getEntrustNatureStat());
    }

    /**
     * 获取系统路径
     * @return
     */
    @RequestMapping("getSystemUrl")
    public Quokka  getSystemUrl() {
        return new Quokka(true, feignClientSystem.getSystemUrl());
    }
}
